import request from '@/utils/request'

export function queryPage(listQuery) {
  return request({
    url: '/news/page',
    method: 'post',
    params: {
      current: listQuery.page,
      size: listQuery.size,
      searchStr: listQuery.searchStr,
      type: listQuery.type
    }
  })
}

export function create(temp) {
  return request({
    url: 'news/add',
    method: 'post',
    data: temp
  })
}

export function update(temp) {
  return request({
    url: 'news/update',
    method: 'post',
    data: temp
  })
}

export function deleteById(id) {
  return request({
    url: 'news/' + id,
    method: 'delete'
  })
}

export function queryInfo(id){
  return request({
    url: 'news/detail/' + id,
    method: 'get'
  })
}
